package cn.wolfcode.mapper;


import cn.wolfcode.domain.Employee;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface EmployeeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Employee record);

    Employee selectByPrimaryKey(Long id);

    List<Employee> selectAll();

    int updateByPrimaryKey(Employee record);

    // 分页过滤
    // 分页查询
//    int selectForCount(QueryObject qo);  // 使用分页后端分页插件，不需要自己写查询数量
    List<Employee> selectForList(QueryObject qo);

    void insertRelation(@Param("empId") Long empId, @Param("roleId") Long roleId);

    void deleteRelation(Long id);

    Employee selectByUsernameAndPassword(@Param("username") String username, @Param("password") String password);
}